<template>
  <div class="slide-item">
    <div class="slide-body">
      <slide-verify
        class="silde_box"
        ref="block"
        :slider-text="text"
        :accuracy="accuracy"
        @success="onSuccess"
        @fail="onFail"
        @refresh="onRefresh"
      ></slide-verify>
    </div>
  </div>
</template>

<script>
import { ElMessage } from "element-plus";
import SlideVerify from "vue3-slide-verify";
import "vue3-slide-verify/dist/style.css";
export default {
  components: {
    // SuccessFilled,
    SlideVerify,
  },
  data() {
    return {
      msg: "",
      text: "向右滑动",
    };
  },
  methods: {
    onSuccess() {
      ElMessage.success("验证成功!");
      setTimeout(() => {
        this.$emit("closeslide");
      }, 1000);
    },
    onFail() {
      ElMessage.warning("未通过验证!");
    },
    onRefresh() {
      this.msg = "";
    },
  },
};
</script>

<style scoped lang="scss">
.slide-item {
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
}
.slide-body {
  width: 360px;
  height: 260px;
  background-color: #fff;
  border-radius: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.silde_box {
  width: 100%;
  color: #000;
  /* height: 100%; */
  /* background-color: #fff; */
}
</style>